<?php
/**
 * @var $this Zend\View\Renderer\PhpRenderer
 */
?>
<div class="row">
    <div class="col-md-12">
        <div class="row">
            <div class="col-lg-3 pull-right">
                <div class="input-group">
                    <input type="text" class="form-control">
                    <span class="input-group-btn">
                        <button class="btn btn-default" type="button" style="font-size: 14px !important;">搜索</button>
                    </span>
                </div><!-- /input-group -->
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="widget">
            <div class="widget-head">
                <div class="pull-left">销售列表</div>
                <div class="widget-icons pull-right">
                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a> 
                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
                </div>  
                <div class="clearfix"></div>
            </div>
            <div class="widget-content medias">

                <table id="record_list" class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>
                                <span class="uni">
                                    <input type="checkbox" id="checkAll">
                                </span>
                            </th>
                            <th>账单号</th>
                            <th>顾客电话</th>
                            <th>总价</th>
                            <th>结账时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($this->paginator->getCurrentItems() as $item):?>
                        <tr data-href="/saleRecord/edit-record/slid/1">
                            <td>                            
                                <span class="uni">
                                    <?php $id = $this->escapeHtml($item->getId());?>
                                    <input type="checkbox" class="ids" value="<?php echo $id?>"/>
                                </span>
                            </td>
                            <td><?php echo $id;?></td>
                            <td><?php
                                    $customer = $item->getCustomer();
                                    echo isset($customer) ? $this->escapeHtml($customer->getPhoneNumber()):'-';
                                ?></td>
                            <td><?php echo $this->escapeHtml($item->getTotalPrice());?></td>
                            <td><?php echo $this->escapeHtml($item->getCreateTime()->format('Y-m-d H:s:i'));?></td>
                            <td>

                                <a class="btn btn-xs btn-default"><i class="icon-pencil"></i> </a>
                                <a onclick="if(!confirm('要删除此订单吗?'))return false;" href="<?php echo $this->url('sale-record/wildcard',array('action'=>'delete','id'=>$id))?>" class="btn btn-xs btn-danger"><i class="icon-remove"></i> </a>

                            </td>
                        </tr>
                    <?php endforeach;?>
                    </tbody>
                </table>

                <div class="widget-foot">

                    <div class="uni pull-left">
                        <select class="form-control" id="formControl">
                            <option value="handle">操作</option>
                            <option value="delete">删除</option>
                        </select>
                    </div>
                    <?php
                        echo $this->paginationControl($this->paginator,
                            'Sliding', 'paginator-control-bar'
                             ,array(
                                'route' => 'sale-record/wildcard'
                             )
                        );
                    ?>
                    <div class="clearfix"></div> 

                </div>

            </div>
        </div>
    </div>
</div>
<?php $this->headScript()->appendScript("require(['main'],function(){require(['page/sale-record/index']);});");?>